package com.service.mybatis.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;

/**
 * @author zhaoj
 * @create 2021/8/31
 */
@MapperScan({"com.ccf.business.*.mapper"})
public class MybatisPlusConfig {

    /**
     * mybatis-plus分页插件
     */
    @Bean
    public PaginationInnerInterceptor paginationInterceptor() {
        PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor();
        paginationInterceptor.setDbType(DbType.MYSQL);
        //设置最大单页限制数量，默认 500 条
        paginationInterceptor.setMaxLimit(Long.MAX_VALUE);
        return paginationInterceptor;
    }
}
